function NavbarSideCtrl($scope, $http) {

    $http({
        url: 'user/getCurrentUser',
        method: 'get'
    }).success(function (response) {
        $scope.realName = response.realName;
        var len = response.authorities.length;
        for (var i = 0; i < len; i++) {
            console.log(response.authorities[i]);
            if (response.authorities[i].authority == 'ROLE_ADMIN') {
                $scope.roleAdmin = true;
            }
            else if (response.authorities[i].authority == 'ROLE_SCHOOL_MANAGER') {
                $scope.roleSchoolManager = true;
            }
            else if (response.authorities[i].authority == 'ROLE_ASSOCIATION_MANAGER') {
                $scope.roleAssociationManager = true;
            }
            else if (response.authorities[i].authority == 'ROLE_STUDENT') {
                $scope.roleStudent = true;
            }
        }
    })
    
}

function NavbarHeaderCtrl($scope, $http) {
    $http({
        url: 'user/getCurrentUser',
        method: 'get'
    }).success(function (response) {
        $scope.realName = response.realName
    })
}